<template>
<div id="login">
     <el-input  placeholder="账号" v-model="ruleForm.username"></el-input>
     <el-input type="password" placeholder="密码" v-model="ruleForm.password"></el-input>
     <el-button type="danger" @click="login">登录</el-button>
</div>
</template>
<script>
export default {
  data () {
    return {
        ruleForm: {
          username: '',
          password: ''
        }
    }
  },
  methods:{
      login(){
           this.$api.login(this.ruleForm).then(res => {
              if (res.code == '000000') {
                // this.$message.success('登录成功')
                this.$router.push('/homePage')
              }
            })
      },
  }
}
</script>
<style>
#login{
  background-image: url("../assets/test1.jpg");
  height: 32rem;
}
</style>
